local skel = fk.CreateSkill {
  name = "lb__tongjie",
}

Fk:loadTranslationTable {
  ["lb__tongjie"] = "通解",
  --[":lb__tongjie"] = "每回合限一次，当一名角色成为伤害牌的目标时，你可以弃置一半手牌（向上取整且至少为1）并令此牌伤害+1。",
  --9.23
  [":lb__tongjie"] = "每回合限一次，当一名角色成为伤害牌的目标时，你可以弃置至少一半手牌（向上取整且至少为1）并令此牌对其伤害+1。",

  ["#lb__tongjie"] = "通解：你可以弃置至少 %arg 张手牌令 %arg2 伤害+1",

  ["$lb__tongjie1"] = "敌方数据收集完毕。",
  ["$lb__tongjie2"] = "开始介入支援。",
  ["$lb__tongjie3"] = "侦察到敌方目标。",
}

skel:addEffect(fk.TargetConfirming, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and data.card.is_damage_card and
        player:usedSkillTimes(skel.name) == 0 and not player:isKongcheng()
  end,
  on_cost = function(self, event, target, player, data)
    local n = math.floor((player:getHandcardNum() / 2) + 0.5)
    local cards = player.room:askToDiscard(player, {
      min_num = n,
      max_num = player:getHandcardNum(),
      skill_name = skel.name,
      include_equip = false,
      prompt = "#lb__tongjie:::" .. n .. ":" .. data.card:toLogString(),
      skip = true,
    })
    event:setCostData(self, { cards = cards })
    return #cards > 0
  end,
  on_use = function(self, event, target, player, data)
    player.room:throwCard(event:getCostData(self).cards, skel.name, player, player)
    data.additionalDamage = (data.additionalDamage or 0) + 1
  end,
})

return skel
